package com.example.demo.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.useri;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
public interface UserDao extends BaseMapper<useri> {


    @Select("select * from useri")
    public List<useri> getAllUser();


    /**
     * 根据id查询数据的方法
     * @param id
     * @return
     */
    @Select("select * from useri where id = #{id}")
    public useri getUserById(int id);




    @Delete("delete  from  useri where id = #{id}")
    public int deleteUserById(int id);

    @Insert("insert into useri values(#{user.id}, #{user.name})")
    public int insertUser(useri user);




}
